var vm = new Vue({
  el : '#app',
  extends: CommonTools,
  
  data : function(){
    return {
      conditions: {
        time: '',
        name:'',
        stuClass:'',
      },
      pageData: {
        page: 1,
        rows: 10,
        total: 0,
        results: []
      },
      currentRow: null,
      gStudent:{},
    }
  },
  

  methods: {  
    
    /**
     * 重新加载
     */
    reload(page, pageSize){
    	  var self = this;
	      page = page? page: this.pageData.page;
	      pageSize = pageSize? pageSize: this.pageData.rows;
	      
	      var url = "../../gStudentController.do?datagrid3&page=" 
        + page + "&rows=" + pageSize;
	      if (this.conditions.name){
	        url += "&name=" + this.conditions.name;
	      }
	      if (this.conditions.stuClass){
	    	  url += "&stuClass=" + this.conditions.stuClass;
	      }
	      this.get(url).then(data => {       
	          self.pageData = data;        
	        }).catch(err => {
	          self.showError(err);
	        });
    },
    
    onEdit(id) {
        window.location.href = "../../gAttendController.do?attendEdit&id="+id;
      },
      
 onQuery(){
    	 this.reload(); 
      }
  },
  
  created() {
    this.reload();
  },
  
});